const tabbarMixins = {
  data: {
    tabbar_active:0
  },
 
  onLoad() {
    this.getDeviceInfo();
  },
  getDeviceInfo() {
    const windowInfo = wx.getWindowInfo();
    const menuButtonInfo = wx.getMenuButtonBoundingClientRect();

    let statusBarHeight = windowInfo.statusBarHeight;
    let navBarHeight =
      menuButtonInfo.height + (menuButtonInfo.top - statusBarHeight) * 2;
    let safeHeight = windowInfo.safeArea.height;
    let bottomSafeHeight =
      windowInfo.screenHeight - windowInfo.safeArea.height - statusBarHeight;

    //@ts-ignore
    this.setData({
      deviceInfo: {
        statusBarHeight,
        navBarHeight,
        safeHeight,
        bottomSafeHeight,
      }
    });
    console.log(this.data.deviceInfo)
  },
  
};

module.exports = tabbarMixins;
